var Dog=require("./dog");

var dog1=new Dog("taidi",3);
var dog2=new Dog("zangao",4);

dog1.on("bark",function(){
    console.log(this)
    console.log(this.name+" barked, energy left "+this.energy)
})
dog2.on("bark",()=>{
    console.log(this)//undefined
    console.log(this.name+" barked, energy left "+this.energy)
})


